<%@ page import="myschool.service.GradeService" %>
<%@ page import="myschool.entity.Grade" %>
<%@ page import="java.util.List" %>
<%@ page import="myschool.service.SubjectService" %>
<%@ page import="myschool.entity.Subject" %><%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2022/7/4
  Time: 17:04
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>修改课程信息表单</title>
    <link rel="stylesheet" href="css/public.css"/>
    <link rel="stylesheet" href="css/style.css"/>
</head>
<body>
<div class="right">
    <div class="location">
        <strong>你现在所在的位置是:</strong>
        <span>学科管理页面 >> 学科修改页</span>
    </div>
    <div class="providerAdd">
    <%
        request.setCharacterEncoding("utf-8");
        int id = Integer.parseInt(request.getParameter("id"));
        Subject subject = SubjectService.ME.find(id);
    %>
    <form action="doSubjectUpdate.jsp?id=<%=id%>" method="post">
        <div class="">
            <label for="sbId">课程编号：</label>
            <input type="text" name="sbname" id="sbId" placeholder="<%=subject.getId()%>" readonly/>
            <span>*</span>
        </div>
        <div class="">
            <label for="providerId">课程名称：</label>
            <input type="text" name="sbname" id="providerId" placeholder="<%=subject.getSubjectname()%>"/>
            <span>*</span>
        </div>
        <div>
            <label for="providerName">学习课时：</label>
            <input type="text" name="sbhour" id="providerName" min="0" placeholder="<%=subject.getClasshour()%>"/>
            <span >*</span>
        </div>
        <div>
            <label for="people">年级编号：</label>
            <select id="people" name="sbgid" ><%
                List<Grade> grades = GradeService.ME.findALL();
                for (Grade g : grades) {
//                    if(g.getId()==subject.getGradeid()){
//                        out.print(g.getName());
//                    }
            %>
                <option  value="<%=g.getId()%>"><%=g.getName()%>
                </option>
                <%}%>
            </select></p>
            <span>*</span>
        </div>

        <div class="providerAddBtn">
            <!--<a href="#">保存</a>-->
            <!--<a href="providerList.html">返回</a>-->
            <input type="submit" value="提交" />
            <input type="button" value="返回" onclick="history.back(-1)"/>
        </div>
    </form>
</div>
</body>
</html>
